<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ page import="org.lsms.dao.impl.*" %>
<%@ page import="org.lsms.bean.*"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    
    <title>Chair View Paper Review Detail Page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="LSMS,ICSEE,CHAIR">
	
	<link rel="stylesheet" type="text/css" href="../css/author_layout.css">
	<link rel="stylesheet" type="text/css" href="../css/hyper_link_style.css">

  </head>
  
  <body>
	<div id="container">
		<div id="header" class="logo_image"></div>
		<div class="nav"></div>
		<div id="author_menu" class="border">
			<table border="0" width="100%"  >
				<tr>
					<td  bgcolor="#CCCCCC"><a href="../index.jsp">Home</a></td>
				</tr>
				<tr>
					<td  bgcolor="#CCCCCC"><a href="chair_decision.jsp">View All Papers/Decision</a></td>
				</tr>
				<tr>
				<%
					DaoImpl impl = new DaoImpl();
					HashMap<String,Integer> hm = impl.get_site_setting();
					int member_invite = hm.get("member_invite");
					if(member_invite==1){
				 %>
					<td  bgcolor="#CCCCCC"><a href="invite_member.jsp">Invite PC Member</a></td>
				<%
					}else{
				 %>
				 	<td  bgcolor="#CCCCCC"><a href="../error/invite_member_forbidden.jsp">Invite PC Member</a></td>	
				<%
					}
				 %>
				</tr>
				<tr>
					<td  bgcolor="#CCCCCC"><a href="member_conf.jsp">Pcmember Confirmation</a></td>
				</tr>
				<tr>
					<td  bgcolor="#CCCCCC"><a href="paper_assign.jsp">Paper Assign</a></td>
				</tr>
				<tr>
					<td  bgcolor="#CCCCCC"><a href="assign_index.jsp">Assign Papers' Indexes</a></td>
				</tr>
				<tr>
					<td  bgcolor="#CCCCCC"><a href="modify_info.jsp">Modify Information</a></td>
				</tr>
				<tr>
					<td  bgcolor="#CCCCCC"><a href="../logout">Log Out</a></td>
				</tr>
			</table>
		</div>
		
		<div id="content" class="bg_color border" >
			<div style="margin:15px">
				<p><b>Paper Reviews</b></p>
				<div id="paper_info">
				<p align="left">Paper Information</p> 
				<table align="center" border="0" style="width:650px">
				<%
					int paper_id = Integer.parseInt(request.getParameter("paper_id"));
					Paper paper = new Paper();
					paper = impl.get_paper_info(paper_id);
				 %>
				<tr>
					<th>Paper ID</th>
					<td style="text-align:left">
					<%
						out.print(paper_id);
					 %>
					</td>
				</tr>
				<tr>
					<th>Title</th>
					<td style="text-align:left">
					<%
						out.print(paper.getPapertitle());
					 %>
					</td>
				</tr>
				<tr>
					<th>Abstract</th>
					<td style="text-align:left">
					<%
						out.print(paper.getPaperabstract());
					 %>
					</td>
				</tr>
				<tr>
					<th>Key Words</th>
					<td style="text-align:left">
					<%
						out.print(paper.getPaperkeywords());
					 %>
					</td>
				</tr>
				<tr>
					<th>Topic 1</th>
					<td style="text-align:left">
					<%
						String topic1_name = paper.getFirsttopic();
						String topic1_content = impl.get_topic_content(topic1_name);
						out.print(topic1_content);
					 %>
					</td>
				</tr>
				<tr>
					<th>Topic 2</th>
					<td style="text-align:left">
					<%
						String topic2_name = paper.getSecondtopic();
						String topic2_content = impl.get_topic_content(topic2_name);
						out.print(topic2_content);
					 %>
					</td>
				</tr>
				<tr>
					<th>Author(s)</th>
					<td style="text-align:left">
					<%
						out.print(paper.getAuthorname());
					 %>
					</td>
				</tr>
				<tr>
					<td colspan="2" style="text-align:center">
					<%
						String savename = "..";
						savename += paper.getSavename();
					 %>
					 <a href="<%=savename %>">DownLoad</a>
					</td>
				</tr>
				</table>
				</div>
			
				<p align="left">Reviewers' Comments</p>
				<div id="reviewers_comments" class="border">
				<table align="center" border="0" style="width:680px">
				<tr>
						<th>Paper ID</th>
						<th>Reviewer ID</th>
						<th>A</th>
						<th>B</th>
						<th>C</th>
						<th>D</th>
						<th>E</th>
						<th>AVE</th>
						<th>Reviewer's expertise</th>
						<th>Recommend</th>
						<th>Note</th>
					</tr>
					<%
						HashMap<String,List<Paper_Grade>> map = impl.get_paper_grade(paper_id);
						List<Paper_Grade> list = map.get("all");
						Iterator it = list.iterator();
						if(list.size()<1){
					%>
					<tr>
						<td colspan="11">
						<p>No Information!</p>
						</td>
					</tr>
					<%
						}
						for(int i=0;i<list.size();i++){
							Paper_Grade paper_grade = list.get(i);
					 %>
					 <tr>
					 	<td style="text-align:center">
					 	<%
					 		out.print(paper_id);
					 	 %>
					 	</td>
					 	<td style="text-align:center">
					 	<%
					 		int reviewer_id = paper_grade.getReviewer_id();
					 		out.print(reviewer_id);
					 	 %>
					 	</td>
					 	<td style="text-align:center">
					 	<%
					 		int a = paper_grade.getProblem_a();
					 		out.print(a);
					 	 %>
					 	</td>
					 	<td style="text-align:center">
					 	<%
					 		int b = paper_grade.getProblem_b();
					 		out.print(b);
					 	 %>
					 	</td>
					 	<td style="text-align:center">
					 	<%
					 		int c = paper_grade.getProblem_c();
					 		out.print(c);
					 	 %>
					 	</td>
					 	<td style="text-align:center">
					 	<%
					 		int d = paper_grade.getProblem_d();
					 		out.print(d);
					 	 %>
					 	</td>
					 	<td style="text-align:center">
					 	<%
					 		int e = paper_grade.getProblem_e();
					 		out.print(e);
					 	 %>
					 	</td>
					 	<td style="text-align:center">
					 	<%
					 		double ave = (a+b+c+d+e)/5;
					 		out.print(ave);
					 	 %>
					 	</td>
					 	<td style="text-align:center">
					 	<%
					 		out.print(paper_grade.getExpertise());
					 	 %>
					 	</td>
					 	<td style="text-align:center">
					 	<%
					 		int recommend = paper_grade.getRecommend();
					 		if(recommend==1){
					 	 %>
					 	 <font color="green">YES</font>
					 	 <%
					 	 }else{
					 	  %>
					 	  <font color="red">NO</font>
					 	  <%
					 	  	}
					 	   %>
					 	</td>
					 	<td style="text-align:center">
					 	<a href="view_note.jsp?paper_id=<%=paper_id%>&reviewer_id=<%=reviewer_id%>">Note</a>
					 	</td>
					 </tr>
					 <%
					 	}
					  %>
				</table>
				</div>
			
				<p align="left">PC member's Comments</p>
				<div id="member_comments" class="border">
					<table align="center" border="0" style="width:680px">
					<tr>
						<th>Paper ID</th>
						<th>Recommend</th>
						<th>Note</th>
					</tr>
					<%
						HashMap map2 = impl.get_member_comment(paper_id);
						Set<Integer> set = map2.keySet();
						if(set.size()<=0){
					%>
					<tr>
						<td>
						<font color='red'>No information!</font>
						</td>
					</tr>
					<% 
						}
						Iterator it2 = set.iterator();
						while(it2.hasNext()){
							int recommend = (Integer)it2.next();		
					%>
					<tr>
						<td style="text-align:center">
						<%
							out.print(paper_id);
						 %>
						</td>
						<td style="text-align:center">
						<%
							if(recommend==1){
								out.print("<font color='green'>YES</font>");
						 	}else{
						 		out.print("<font color='red'>NO</font>");
						 	}
						 %>
						</td>
						<td>
						<%
							String comment = map2.get(recommend).toString();
							out.print(comment);
						 %>
						</td>
					</tr>
					<%
						}
					 %>
					</table>
				</div>

				<p align='left'>My suggestion to author</p>
				<div id="chair_comment" class='border'>
				<form action="../chair_comment?paper_id=<%=paper_id%>" method='post'>
				<table align='center' style="width:680px" border='0px'>
				<tr>
			 		<td>
			 			Suggestion to author
			 		</td>
			 		<td>
			 			<textarea cols="35" rows="5" name="chair_to_author" ></textarea>
			 		</td>
			 	</tr>
			 	<tr>
			 		<td>
			 			Pass
			 		</td>
			 		<td>
			 			<input type="radio" name="pass" value="1" checked>Yes&nbsp;
			 			&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			 			<input type="radio" name="pass" value="0">No&nbsp;
			 		</td>
			 	</tr>
			 	<tr>
			 		<td>
			 		<br>
			 		</td>
			 	</tr>
			 	<tr>
			 		<td colspan="2" style="text-align:center">
			 		<input type="submit" value="Submit" onclick="return window.confirm('Are You Sure?')">
			 		</td>
			 	</tr>
				</table>
				</form>
				</div>
			</div>
		</div>
		
		<div class="nav"></div>
			
		<div id="footer" class="footer_color border">
			<p align="center"><b>&copy;2010 LSMS-All Rights Reserved.</b></p>
			<p align="center"> <b>Powered by Shu.</b></p>
		</div>
	</div>
  </body>
</html>
